]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
padOsd: Capture events on itself
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 24 Nov 2021 16:42:41 +0000 (17:42 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 29 Jan 2022 00:16:30 +0000 (01:16 +0100)
This actor is setting itself modal, should also stop listening to
events from above it, since none will be gotten.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>

js/ui/padOsd.js

index 9804f9e305748bdda4a87420c1f1a5527d5a0451..9de5b49276161cefcc00bb32e626e5dcc57b05cb 100644 (file)
@@ -638,7 +638,6 @@ var PadOsd = GObject.registerClass({
         this._settings = settings;
         this._imagePath = imagePath;
         this._editionMode = editionMode;
-        this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
         this._padChooser = null;
 
         let seat = Clutter.get_default_backend().get_default_seat();
@@ -762,7 +761,7 @@ var PadOsd = GObject.registerClass({
         this._padDiagram.updateLabels(this._getActionText.bind(this));
     }
 
-    _onCapturedEvent(actor, event) {
+    vfunc_captured_event(event) {
         let isModeSwitch =
             (event.type() == Clutter.EventType.PAD_BUTTON_PRESS ||
              event.type() == Clutter.EventType.PAD_BUTTON_RELEASE) &&
@@ -933,11 +932,6 @@ var PadOsd = GObject.registerClass({
             this._deviceAddedId = 0;
         }
 
-        if (this._capturedEventId != 0) {
-            global.stage.disconnect(this._capturedEventId);
-            this._capturedEventId = 0;
-        }
-
         this.emit('closed');
     }
 });